using System;
using System.Collections.Generic;
using System.Text;
using DAL;
using Entities;

namespace BUS
{
 public    class tbDulichBUS
    {
        public static void insert(tbDulich  dlich)
        {
          tbDulichDAL  dlichDAL = new tbDulichDAL ();
            dlichDAL .Insert (dlich );

        }
        public static void update(tbDulich  dlich)
        {
          tbDulichDAL  dlichDAL = new tbDulichDAL ();
            dlichDAL.Update (dlich );

        }
     public static void Delete(int iD)
     {
         tbDulichDAL  dlDAL = new tbDulichDAL ();
         dlDAL.Delete(iD);
     }
        public static tbDulichCollection  Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbDulichDAL  dlDAL = new tbDulichDAL ();
            return dlDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }

        public static tbDulichCollection  GetALL()
        {
            int total = 0;
          tbDulichDAL dlDAL = new tbDulichDAL ();
            return dlDAL.Get("where 1=1", 0, 0,tbDulichColumns .Madul .ToString(), "ASC", out total);
        }
        public static tbDulich  GetByID(int iD)
        {
            int total = 0;
            tbDulichDAL  dlDAL = new tbDulichDAL ();
           tbDulichCollection  dlCollection = dlDAL.Get("where " +
            tbDulichColumns .Madul .ToString() + "=" + iD.ToString(),
                0, 0, tbDulichColumns .Madul .ToString(), "ASC", out total);
            if (dlCollection.Count > 0)
                return dlCollection[0];
            return null;
        }
    }
}
